package com.dragon.user_service;

import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import org.apache.seata.spring.annotation.GlobalTransactionScanner;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;

//@SpringBootApplication
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class, // 禁用 Spring Boot 默认的数据源自动配置
        DataSourceTransactionManagerAutoConfiguration.class, // 禁用 Spring Boot 默认的数据源事务管理器自动配置
        MybatisPlusAutoConfiguration.class // 禁用 MyBatis-Plus 默认的自动配置
})
@EnableAsync
@EnableAspectJAutoProxy(exposeProxy = true)
@MapperScan("com.dragon.user_service.mapper")
public class UserServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserServiceApplication.class, args);
    }
//新增
    @Bean
    public GlobalTransactionScanner globalTransactionScanner() {
        return new GlobalTransactionScanner("user_service", "user_service_group");
    }
}
